<template>
	<view class="index">
		<!--搜索栏-->
		<view  class="search-top">
	  	<search-hd></search-hd>
		</view>
		<!--九宫格 应用-->
		<menu-bar :rokinglists="rokinglists"></menu-bar>
		<!--西视数据 动态 -->
		<view class='wrap'>
			<view class='icon-title'>
				<image src="https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon13.png" class='icon-img'></image>
				<text class='text'>影视评估</text>
			</view>
			<template v-if="companyList.length !== 0">
				<content-list :isfirstloading="isfirstloading" page-number="index" :items="companyList" @toDetailsPage="toDetailsPage"/>
				<!-- <view class='more-box' bindtap='toShowMore'>更多</view> -->
			</template>
			<template v-else>
				<view class='nodata'>
					<view>无数据显示</view>
				</view>
			</template>		
		</view>
	</view>
</template>

<script>
	const api = require("../../../wxapi/config.js")
	import MenuBar from '../../../component/menu-bar/MenuBar'
	import SearchHd from '../../../component/search-hd/SearchHd'
	import ContentList from '../../../component/show-index/ContentList'
	export default {
		components: {SearchHd, ContentList, MenuBar},
		data() {
			return {
				// title: 'Hello'
				isfirstloading: true,
				showNodata: false,
				rokinglists: [
					{
						name: '电影榜',
						url: '/pages/index/RankingList/film/film',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon01.png'
					},
					{
						name: '电视剧榜',
						url: '/pages/index/RankingList/teleplay/teleplay',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon02.png'
					},
					{
						name: '网剧榜',
						url: '/pages/index/RankingList/netplay/netplay',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon03.png'
					},
					{
						name: '艺人影响力',
						url: '/pages/index/RankingList/artist/artist',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon04.png'
					},
					{
						name: '院线票房',
						url: '/pages/index/RankingList/boxoffice/boxoffice',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon05.png'
					},
					{
						name: '电影排片',
						url: '/pages/index/RankingList/filmpaipian/filmpaipian',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon06.png'
					},
					{
						name: '卫视收视',
						url: '/pages/index/RankingList/tvRatings/tvRatings',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon07.png'
					},
					{
						name: '网播平台',
						url: '/pages/index/RankingList/netplatform/netplatform',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon08.png'
					},
					{
						name: '政策法规',
						url: '/pages/index/RankingList/policy/policy',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon09.png'
					},
					{
						name: '备案分析',
						url: '/pages/index/RankingList/plan/plan',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon10.png'
					},
					{
						name: '发行分析',
						url: '/pages/index/RankingList/release/release',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon11.png'
					},
					{
						name: '影视资讯',
						url: '/pages/index/RankingList/thermal/thermal',
						src: 'https://cdn.xtde.cn/wxapp/xtde/img-icons/img-icon12.png'
					}
				],
				companyList: [],
				pageSize: 10
			}
		},
		onLoad() {
			this.getCompanyList('', '', 10)
		},
		methods: {
			getCompanyList (id, date, size) {
				api.getRecommendList(id, date, size).then((res) => {
					if (res.data.data.length !== 0) {
						this.isfirstloading = false;
						this.showNodata = false;
						this.companyList = res.data.data
					} else {
						this.isfirstloading = false;
						this.showNodata = true;
						this.companyList = []
					}
				})
			},
			toDetailsPage (aid) {
				console.log(aid)
				uni.navigateTo({
					url: '/pages/index/index/detail/detail?id=' + aid
				})
			}
		}
	}
</script>

<style scoped>
	/* .content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200upx;
		width: 200upx;
		margin-top: 200upx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50upx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36upx;
		color: #8f8f94;
	} */
	.icon-title {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
	}
	.icon-title .icon-img {
	  width: 29rpx;
	  height:34rpx;
	}
	.search-top{
		margin-bottom: 40rpx;
	}
	.newslist .news-item {
		border-bottom: 1rpx solid #dbdcde;
	}
	.newslist .news-item navigator, .newslist .news-item .newRow{
		padding: 13rpx 6rpx;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
	}
	.newslist .news-item .news-img{
		width: 80rpx;
		height: 80rpx;
		border-radius: 40rpx;
		margin-right: 25rpx;
		-webkit-box-flex: 0;
		-webkit-flex: none;
		flex: none;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		-webkit-box-pack: center;
		-webkit-justify-content: center;
		justify-content: center;
	}
	.newslist .news-item .news-cont{
		position: relative;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		padding-top: 6rpx;
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-webkit-flex-direction: column;
		flex-direction: column;
		min-width: 0;
	}
	.newslist .news-item .news-title{
		color: #292d30;
		font-size: 30rpx;
		line-height: 39rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.newslist .news-item .news-desc{
		color: #9ca3a9;
		font-size: 22rpx;
		line-height: 35rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.more-box{
	  margin: 20rpx 100rpx;
	  text-align: center;
	  padding: 10rpx 20rpx;
	  color: #40a9ff;
	  border: 1rpx solid #40a9ff;
	  border-radius: 30rpx;
	  font-size: 25rpx;
	}

</style>
